from Page.page1 import Page1
from selenium.webdriver.common.by import By

class Page2(Page1):

    # 我的酒仙定位 /html/body/div[2]/div/div[2]/ul/li[1]/div[1]/a
    jiuxian_loc = (By.XPATH,'/html/body/div[2]/div/div[2]/ul/li[1]/div[1]/a')
    # 关闭弹窗  uGuideClose
    close_loc = (By.CLASS_NAME,'uGuideClose')
    # 收获地址的定位 /html/body/div[4]/div[1]/div[2]/div[4]/a[3]/span
    address_loc = (By.XPATH,'/html/body/div[4]/div[1]/div[2]/div[4]/a[3]/span')
    # 添加新地址的定位 addressTrue
    new_address_loc = (By.CLASS_NAME,'addressTrue')
    # 收货人的定位 people
    people_loc = (By.ID,'addressTrue')

    # 我的酒仙定位点击
    def jiuxian(self):
        self.click(self.jiuxian_loc)
    # 关闭弹窗的点击
    def close(self):
        self.click(self.close_loc)
    # 收获地址的定位的点击
    def address(self):
        self.click(self.address_loc)
    # 添加新地址的定位的点击
    def new_address(self):
        self.click(self.new_address_loc)
    # 收货人的定位输入
    def people(self):
        self.send_keys(self.people_loc,'王五')




    def jiuxian_luoji2(self):
        self.jiuxian_login_luoji()
        self.jiuxian()
        # 窗口切换
        self.new_window()
        self.close()
        # 下滑 800
        self.scroll_x(800)
        self.address()
        self.new_address()
        self.people()

